package com.hnxxxy.statistics.controller;

import com.github.pagehelper.PageHelper;
import com.hnxxxy.common.tools.Help;
import com.hnxxxy.common.tools.TableObj;
import com.hnxxxy.statistics.service.TotalService;
import com.hnxxxy.statistics.vo.JfTotalVo;
import com.hnxxxy.usermgr.pojo.User;
import jdk.nashorn.internal.runtime.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 *
 * @author：zqh
 * @Phone：17680560413
 * @E-mail：205757245@qq.com
 * @date:2020年6月25日11:40:30
 */

@Controller
@RequestMapping("/total")
public class TotalController {

    @Autowired
    private TotalService totalService;

    @RequestMapping("/toTotal")
    public String ToTotal(){
        return "statistics/scorerank";
    }

    @RequestMapping("/findAllUser")
    @ResponseBody
    public TableObj findAllUser(TableObj tableObj){
        PageHelper.startPage(tableObj.getCurr(), tableObj.getNums());
        List<JfTotalVo> list =  totalService.findTotalRank();
        return Help.getPageTableRtn(tableObj,list);
    }
}
